<!--<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css?v=v3.3.7" media="all">
    <link rel="stylesheet" type="text/css" href="../css/font/iconfont.css?v=1.0.0" media="all">
    <link rel="stylesheet" type="text/css" href="../css/layui.css?v=1.0.9" media="all">
</head>
<body>-->
<div style="display: inline-block; width: 100%; height: 100%; padding: 10px; border: 1px solid #ddd;
 overflow: auto;" >
    <ul id="demo1"></ul>
</div>
<script src="../js/layui/layui.js"></script>
<script>
    //Demo
    layui.use(['tree', 'layer'], function(){
        var layer = layui.layer
                ,$ = layui.jquery;
        var module = getModule();
        $.post('/education/admin/'+ module +'/treeData', function(rs){
            console.log(rs)
            if(rs.data && rs.data[0].id == '0'){
                rs.data[0].spread = true;
            }
            layui.tree({
                elem: '#demo1' //指定元素
                ,target: '_blank' //是否新选项卡打开（比如节点返回href才有效）
                ,click: function(item){ //点击节点回调
                    //layer.msg('当前节名称：'+ item.name + '<br>全部参数：'+ JSON.stringify(item));
                    console.log($(this))
                    afterChecked(item);
                }
                ,nodes: rs.data
                ,spread: true,
            });

            var  frameindex= parent.layer.getFrameIndex(window.name);
            $('.layui-layer-btn0').click(function(){
                parent.layer.close(frameindex);
            })


        });

        /*$("body").on("mousedown",".layui-tree a",function(){
            if(!$(this).siblings('ul').length){
                $(".layui-tree a cite").css('color','#333');
                $(this).find('cite').css('color','red');
            }
        });*/
        $("body").on("mousedown",".layui-tree a cite",function(){
            $(".layui-tree a cite").css('color','#336699');
            $(".layui-tree a cite").parent().css('background-color', 'white');
            $(this).css('color','red')
            $(this).parent().css('background-color', 'antiquewhite');
        });

    });
</script>
<!--
</body>
</html>-->
